﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace OrmSmackdown
{
    public class Support
    {
        public static void CleanDatabase(IDbConnection conn)
        {
            var cmd = conn.CreateCommand();
            cmd.Connection.Open();

            cmd.CommandText = "delete from portalpeoplexref_ls";
            cmd.ExecuteNonQuery();
            cmd.CommandText = "delete from portalpeoplexref";
            cmd.ExecuteNonQuery();
            cmd.CommandText = "delete from portals";
            cmd.ExecuteNonQuery();
            cmd.CommandText = "delete from addresses";
            cmd.ExecuteNonQuery();
            cmd.CommandText = "delete from people";
            cmd.ExecuteNonQuery();
            cmd.CommandText = "delete from roles";
            cmd.ExecuteNonQuery();
            cmd.CommandText = "delete from companies";
            cmd.ExecuteNonQuery();

            cmd.Connection.Close();            
        }
    }
}
